'''
作者:袁俊
描述:将后台端订单管理页面封装为一个类
'''
# 引入模块
from MY_ECShop.common.base import Base, create_browser,create_loading_browser
import time


# 创建订单管理页面类
class PageMenu(Base):
    url = 'http://localhost:8080/ecshop/admin/index.php'  # ECShop后台端登录页网址
    order_management = ('css selector', "li[key='04_order']")  # 订单管理按钮
    orderlist = ('link text', '订单列表')  # 订单列表按钮
    orderquery = ('link text', '订单查询')  # 订单查询按钮
    menu_frame = 'menu-frame'  # menu-frame
    main_frame = "main-frame"  # main-frame

    # 自动化登录进入后台端
    def page_menu_background_open(self):
        self.base_open_web(self.url)
    # 进入menu-iframe
    def page_menu_into_menu_iframe(self):
        self.base_name_iframe_window(self.menu_frame)

    # 进入main-iframe
    def page_menu_into_main_iframe(self):
        self.base_name_iframe_window(self.main_frame)

    # 点击订单管理按钮
    def page_menu_click_ordermanage(self):
        self.base_click(self.order_management)

    # 点击订单列表按钮
    def page_menu_click_orderlist(self):
        self.base_click(self.orderlist)

    # 点击订单查询按钮
    def page_menu_click_orderquery(self):
        self.base_click(self.orderquery)

    # 退出menu-iframe和main_iframe
    def page_menu_quit_iframe(self):
        self.base_quit_all_iframe()


if __name__ == '__main__':
  pass